package com.test.security.springsecuritydemo10.controller;

import org.springframework.security.web.csrf.CsrfToken;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created with IntelliJ IDEA.
 *
 * @author： liuziyang
 * @date： 2023/1/3-22:13
 * @description：
 * @modifiedBy：
 * @version: 1.0
 */
@RestController
public class HelloController {
  @GetMapping("/hello")
  public String getHello() {
    return "get hello";
  }

  @PostMapping("/hello")
  public String hello() {
    return "hello";
  }

  @PostMapping("/ciao")
  public String ciao() {
    return "ciao";
  }

  @GetMapping("/csrf-token")
  public CsrfToken getCsrfToken(CsrfToken token) {
    return token;
  }
}
